# !usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Author:张广勤
@Web site: https://www.tunan.wang
@Github:www.github.com
 
@File:daojishi1_0.py
@Time:2024/11/4 17:58

@Motto:不积跬步无以至千里，不积小流无以成江海！
"""

import time

def daojishi(n):
    # 设置倒计时时间（秒）
    countdown_time = n * 60  # 5分钟
    while countdown_time > 0:
        minutes, seconds = divmod(countdown_time, 60)
        # 使用 \r 回到行首，end='' 防止换行
        print(f"\r倒计时: {minutes:02}:{seconds:02}", end='')
        time.sleep(1)
        countdown_time -= 1
    print("\n倒计时结束！")

daojishi(1/6)